package com.example.administrator.myapplication;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

/**
 * Created by Lx on 2018/10/15.
 */

public class Fragment_one extends Fragment {


    String str;

    Button btnOne;


    @Override
    public void onAttach(Context context) {
        super.onAttach(context);

        Bundle arguments = this.getArguments();
        assert arguments != null;
        str = arguments.getString("one");

    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        View view = View.inflate(getContext(), R.layout.view_one, null);
        init(view);
        return view;
    }

    private void init(View view) {
        btnOne = view.findViewById(R.id.btn_one);
        btnOne.setText(str);
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();

    }
}
